#include "kukaforcesensorguideinstance.h"
#include "kukaforcesensorguideinstance_global.h"

static KUKAForceSensorGuideInstance* pKUKAForceSensorGuideInstance = nullptr;

short PLU_KPluginInstanceCreate(short Local_Remote){
    if(pKUKAForceSensorGuideInstance == nullptr){
        pKUKAForceSensorGuideInstance = new KUKAForceSensorGuideInstance(Local_Remote);
    }
    return 1;
}

short PLU_KPluginInstanceDelete(){
    if(pKUKAForceSensorGuideInstance != nullptr){
        delete pKUKAForceSensorGuideInstance;
    }
    return 1;

}

bool PLU_KPluginInstanceExists(){
    if(pKUKAForceSensorGuideInstance != nullptr) return true;
    else                                 return false;
}

QWidget* PLU_KPluginInstanceUiRegesiter(){
    return pKUKAForceSensorGuideInstance->getUiHandle();

}

void TASK_kukaloop_KUKADataProcess(){
    if(pKUKAForceSensorGuideInstance != nullptr){
        pKUKAForceSensorGuideInstance->task_kukaloop_KUKAProcess();
    }
}

void TASK_maininit_ForceSensorConnect(){
    if(pKUKAForceSensorGuideInstance != nullptr){
        pKUKAForceSensorGuideInstance->task_maininit_ForceSensorConnect();
    }
}

void TASK_mainloop_ForceSensorLoopRun(){
    if(pKUKAForceSensorGuideInstance != nullptr){
        pKUKAForceSensorGuideInstance->task_mainloop_ForceSensorLoopRun();
    }
}

void TASK_uifast_ForceScopeUpdate(){
    if(pKUKAForceSensorGuideInstance != nullptr){
        pKUKAForceSensorGuideInstance->task_uifast_ForceScopeUpdate();
    }
}

void TASK_uifast_RobotScopeUpdate(){
    if(pKUKAForceSensorGuideInstance != nullptr){
        pKUKAForceSensorGuideInstance->task_uifast_RobotScopeUpdate();
    }
}

void TASK_RemoteDataRecv(QByteArray Data){
    if(pKUKAForceSensorGuideInstance != nullptr){
        pKUKAForceSensorGuideInstance->task_com_RemoteDataRecv(Data);
    }
}

void TASK_RemoteDataSend(QByteArray& Data){
    if(pKUKAForceSensorGuideInstance != nullptr){
        pKUKAForceSensorGuideInstance->task_com_RemoteDataSend(Data);
    }
}

void TASK_uifast_UiDataUpdate(){
    if(pKUKAForceSensorGuideInstance != nullptr){
        pKUKAForceSensorGuideInstance->task_uifast_UiDataUpdate();
    }
}
